package com.zzr.jdk8.source.demo.collection;

import org.junit.Test;

import java.util.TreeMap;

/**
 * @author: xiaomi
 * @date: 2021/9/14
 * @description: 通过比较器进行排序
 */
public class TreeMapDemo {

    @Test
    public void newTreeMap() {
        TreeMap treeMap = new TreeMap();
        int num = 1;
        for (int i = 0; i < 30; i++) {
            treeMap.put(num, i);
            num <<= 1;
        }
        System.out.println("treeMap = " + treeMap);
    }

}
